/* Copyright 2008 Robert C. Brinson <rbrinson@gmail.com>
 * 
 * This file is part of PictureTagger.
 *
 * PictureTagger is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * PictureTagger is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with PictureTagger.  If not, see <http://www.gnu.org/licenses/>.
 */

using System;
using PictureTagger.PictureTaggerUtility;

namespace PictureTagger.PictureCollection
{
	public class SpecificationCaption : IMetaDataSpecification
	{
		public bool Check(string metaDataName)
		{
			bool match = false;
			if (metaDataName == ExifToolTags.IPTC_CAPTION)
			{
				match = true;
			}
			return match;
		}
		
		public void UpdateMetaData(ref Picture photo, string metaDataValue)
		{
			photo.Caption = metaDataValue;
		}
		
		public void ResetMetaData(ref Picture photo)
		{
			if (photo.IsCaptionDirty)
			{
				photo.ResetCaption();
			}
		}
	}
}